require "import";
import "android.content.Context"
import "android.os.VibrationEffect"
import "android.os.Vibrator"
import "android.content.Intent"
context = activity or service
vibrator = context.getSystemService(Context.VIBRATOR_SERVICE)
vibrator.vibrate(100)


local on= "Lanternă,Pornit*|Lanternă,Activa*|Lanternă, Activ*|Lanternă,Activ*" 

local off= "Lanternă,Oprit*|Lanternă,Dezactiva*|Lanternă, Dezact*|Lanternă,Dezact*" 


service.execute('Suspendare motor TTS principal')
if service.execute('快速设置') then
service.postExecute(500, '', node, function()
if this.findAccessibilityNodeInfo(off) then
this.click({
{off .. ">5$0", 
'%返回<2'}
})
service.playSoundTick()
this.postSpeak(2300,  'Lanternă, Activată. ')
service.postClick(2250,{
"%Suspendare motor TTS principal"})
elseif this.findAccessibilityNodeInfo(on) then
this.click({
{on .. ">5$0", 
'%返回<2'}
})
service.playSoundGestureEnd()
this.postSpeak(2300, ' Lanternă, dezactivată. ')

service.postClick(2250,{
"%Suspendare motor TTS principal"})
end
end)
return true
end